/**
 * Course Project for User Interface Programming I, 2011
 * Group 19
 */
package justdoit.view;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import justdoit.controller.LanguageManager;

/**
 *
 * @author Can
 */
public class HelpDialog extends JDialog {

    private JLabel teamLable;
    private JPanel aboutPanel;
    private JButton okButton;

    public HelpDialog() {
        initComponents();
    }

    private void initComponents() {
        teamLable = new JLabel(LanguageManager.getString("label.help"));
        okButton = new JButton(LanguageManager.getString("button.ok"));
        okButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                HelpDialog.this.dispose();
            }
        });

        aboutPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));

        aboutPanel.add(teamLable);

        this.setLayout(new BorderLayout());
        this.add(BorderLayout.CENTER, aboutPanel);
        this.add(BorderLayout.SOUTH, okButton);

        this.getRootPane().setDefaultButton(okButton);

        this.setModal(true);
        this.setResizable(false);
        this.setSize(400, 250);
        this.setLocationRelativeTo(null);
        this.setTitle(LanguageManager.getString("title.helpDialog"));
    }
}
